﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess.Classes;

public partial class BillDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
            PopulateControls();
    }

    private void PopulateControls()
    {
        string cid = Request.QueryString["cid"] ?? "";
        lblTitle.Text = "Bill number: " + cid;
        List<BillDetail> li = BillDetail.All(int.Parse(cid));
        grid.DataSource = li;
        grid.DataBind();
        lblTotal.Text = BillDetail.TotalAmount(int.Parse(cid));
    }
}